<?php

/**
 * @author Terry & 千里孤坟
 * @copyright 2009
 */
class AbnormalSkill {
	
	public function __construct() {
		$this->id = -1;
		$this->name = "异常基类";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 60;
		$this->ap = 0;
		
		$this->pwr = 0;			//基本攻击值		
		$this->hits = 0;			//最终命中补正
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		$this->crt = 0;				//会心补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
								
		$this->ref = 0;			//强制反射
		
	}
	
	public function checkex($a) {
		if(isset($this->excid) && in_array($a->cid,$this->excid)) {
			$this->name = "<font color=blue>EX".$this->name."</font>";
			$this->ex = 1;
			$this->exskset();
		}
	}

	public function exskset() {
		return 1;
	}

	//起始函数，单体型
	public function start($a,$b,$atkid,$defid,$defer) {
		
		$sk->action($a[$atkid],$defer);											
	
	}
	
	//行动函数
	public function action($a,$b) {
		
	}
}

class SingleAbnSkill extends AbnormalSkill {

	public function __construct() {
		$this->id = -1;
		$this->name = "单体异常基类";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 0;
		$this->ap = 0;
		
		$this->pwr = 0;			//基本攻击值		
		$this->hits = 0;			//最终命中补正
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		$this->crt = 0;				//会心补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
								
		$this->ref = 0;			//强制反射
	}

	//起始函数，单体型
	public function start($a,$b,$atkid,$defid,$defer) {		
		$this->checkex($a[$atkid]);
		CalHelper::cost_cal($a[$atkid],$this);
		$sk = clone $this;
		/** 对b的防御性技能影响状态数组遍历 **/
		foreach($defer->defskill_status as $dss) {
			if($dss->on == 1)
				$dss->action($a[$atkid],$defer,$sk);
		}
		$sk->action($a[$atkid],$defer);
	}

}

class AllAbnSkill extends AbnormalSkill {

	public function __construct() {
		$this->id = -1;
		$this->name = "全体异常基类";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 0;
		$this->ap = 0;
		
		$this->pwr = 0;			//基本攻击值		
		$this->hits = 0;			//最终命中补正
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		$this->crt = 0;				//会心补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
								
		$this->ref = 0;			//强制反射
		
	}

	//起始函数，全体攻击型
	public function start($a,$b,$atkid,$defid,$defer) {
		
		$this->tgtnum = CalHelper::live_count($b);
		$this->checkex($a[$atkid]);
		CalHelper::cost_cal($a[$atkid],$this);
		
		foreach($b as $d) {
			if($d->hp <= 0 || $d->escaping == 1) continue;
			$sk = clone $this;
			/** 对b的防御性技能影响状态数组遍历 **/
			foreach($d->defskill_status as $dss) {
				if($dss->on == 1)
					$dss->action($a[$atkid],$d,$sk);
			}
			$sk->action($a[$atkid],$d);											
		}
	}
}

class PoisonMa extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 305;
		$this->name = "ポイズマ";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 30;
		$this->ap = 3;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
		$this->excid = array(11,89,133);		
	}
	
	public function exskset() {
		$this->god_abn = 1;
		$this->ap = 4;
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."向".$b->name."发动".$this->name."<br>";
		StatusHelper::poison($a,$b,50,$this);
	}
}	

class PoisonMist extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 306;
		$this->name = "ポイズンミスト";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 50;
		$this->ap = 4;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正

		$this->tgtnum = 1;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."施放出一大团毒雾。<br>";
		StatusHelper::poison($a,$b,40,$this);									
	}
}	

class MalinKalin extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 307;
		$this->name = "マリンカリン";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 30;
		$this->ap = 3;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
		$this->excid = array(93,110,137);
	}

	public function exskset() {
		$this->god_abn = 1;
		$this->ap = 4;	
	}

	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."向".$b->name."使出".$this->name."<br>";
		StatusHelper::lure($a,$b,50,$this);
	}
}	

class SexyDance extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 308;
		$this->name = "セクシーダンス";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 50;
		$this->ap = 4;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
		
	}
	
	public function action($a,$b) {
		if($a->cid == 43) {
			CalHelper::spec_talk($this,1,$a->name."抬起裹着黑色丝袜的纤纤细腿，足尖顶着高跟鞋在".$b->name."面前来回晃动，仿佛暗示着什么。");
			CalHelper::cgdisplay('lili_6.jpg');
		} else {
			$_SESSION['show'] .= $a->name."开始向".$b->name."大跳低俗舞。<br>";
		}
		StatusHelper::lure($a,$b,40,$this);
	}
}	

class Bersaka extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 309;
		$this->name = "バルサック";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 30;
		$this->ap = 3;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
		$this->excid = array(70,102);	
	}

	public function exskset() {
		$this->god_abn = 1;
		$this->ap = 4;
	}
	
	public function action($a,$b) {
		list($g1,$p1) = CalHelper::getitbyuuid($a->uuid);
		list($g2,$p2) = CalHelper::getitbyuuid($b->uuid);
		$_SESSION['show'] .= $a->name."向".$b->name."施放狂暴魔力。<br>";
		if($g1 == $g2) {
			StatusHelper::high($a,$b,-100,$this);	//对同组目标必中
		} else {
			StatusHelper::high($a,$b,50,$this);
		}
	}
}	

class BabarianDance extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 310;
		$this->name = "バリアントダンス";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 50;
		$this->ap = 4;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."跳起狂野的舞蹈。<br>";
		StatusHelper::high($a,$b,40,$this);									
	}
}	

class Magasha extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 311;
		$this->name = "マカジャマ";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 30;
		$this->ap = 3;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
		$this->excid = array(75);
	}
	
	public function exskset() {
		$this->god_abn = 1;
		$this->ap = 4;
	}

	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."向".$b->name."使出".$this->name."<br>";
		StatusHelper::close($a,$b,50,$this);
	}
}

class FoolSigh extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 312;
		$this->name = "愚者のささやき";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 50;
		$this->ap = 4;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."向".$b->name."使出".$this->name."<br>";
		StatusHelper::close($a,$b,40,$this);									
	}
}

class PalalaEye extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 313;
		$this->name = "パララアイ";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 30;
		$this->ap = 3;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
		$this->excid = array(26,107);
	}
	
	public function exskset() {
		$this->god_abn = 1;
		$this->ap = 4;
	}

	public function action($a,$b) {
		if($a->cid == 1) {
			$_SESSION['show'] .= "色中有无量化佛。是诸化佛异口同音！<br>";
			CalHelper::cgdisplay('teaplum_11.jpg');
		}
		$_SESSION['show'] .= $a->name."向".$b->name."睁开带有魔力的双眼，发动".$this->name."<br>";
		StatusHelper::pala($a,$b,50,$this);
	}
}	

class ShakoWave extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 314;
		$this->name = "ショックウェーブ";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 50;
		$this->ap = 4;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."使出".$this->name."。<br>";
		StatusHelper::pala($a,$b,40,$this);									
	}
}	

class Freeha extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 315;
		$this->name = "プリンパ";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 30;
		$this->ap = 3;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
		$this->excid = array(47,131);		
	}
	
	public function exskset() {
		$this->god_abn = 1;
		$this->ap = 4;
	}

	public function action($a,$b) {
		if($a->cid == 1) {
			$_SESSION['show'] .= "汝已经混乱了<br>";
			CalHelper::cgdisplay('teaplum_11.jpg');
		}
		$_SESSION['show'] .= $a->name."向".$b->name."使出".$this->name."<br>";
		StatusHelper::confuse($a,$b,50,$this);
	}
}	

class DendRafu extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 316;
		$this->name = "テンタラフー";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 50;
		$this->ap = 4;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."向".$b->name."使出".$this->name."<br>";
		StatusHelper::confuse($a,$b,40,$this);									
	}
}	

class DevilAttach extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 317;
		$this->name = "デビルタッチ";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 30;
		$this->ap = 3;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
		$this->excid = array(95);
	}
	
	public function exskset() {
		$this->god_abn = 1;
		$this->ap = 4;
	}

	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."向".$b->name."使出".$this->name."<br>";
		StatusHelper::terror($a,$b,50,$this);
	}
}	

class SwabSmile extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 318;
		$this->name = "デビルスマイル";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 50;
		$this->ap = 4;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."露出恐怖的微笑表情。<br>";
		StatusHelper::terror($a,$b,40,$this);
	}
}	

class AyJingu extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 319;
		$this->name = "エイジング";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 30;
		$this->ap = 3;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
		$this->excid = array(74,106);
	}
	
	public function exskset() {
		$this->god_abn = 1;
		$this->ap = 4;
	}

	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."向".$b->name."使出".$this->name."<br>";
		StatusHelper::old($a,$b,50,$this);
	}
}	

class AltWorm extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 320;
		$this->name = "オールド·ワン";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 50;
		$this->ap = 4;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."向".$b->name."使出".$this->name."<br>";
		StatusHelper::old($a,$b,40,$this);
	}
}

class PetraEye extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 321;
		$this->name = "ぺトラアイ";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 90;
		$this->ap = 7;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."向".$b->name."使出".$this->name."<br>";
		StatusHelper::close($a,$b,60,$this);
	}
}

class HellsEye extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 322;
		$this->name = "ヘルズアイ";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 90;
		$this->ap = 7;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."向".$b->name."使出".$this->name."<br>";
		StatusHelper::pala($a,$b,60,$this);
	}
}


class BodyLiberate extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 323;
		$this->name = "肉体の解放";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 90;
		$this->ap = 7;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."向".$b->name."展现出钢铁般肉体的魅力。<br>";
		if($b->gender == 1) {
			$_SESSION['show'] .= $b->name."一副你有我也有的样子，完全没有反映。";
		} else {
			StatusHelper::lure($a,$b,60,$this);
		}
	}
}

class TopBody extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 324;
		$this->name = "極上の肉体";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 90;
		$this->ap = 7;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."向".$b->name."展示出自己性感的身段。<br>";
		if($b->gender == 0) {
			$_SESSION['show'] .= $b->name."觉得自己不比".$a->name."差，露出无趣的表情。<br>";
		} else {
			StatusHelper::lure($a,$b,60,$this);
		}
	}
}	

class PornIsNull extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 325;
		$this->name = "色即是空";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 100;
		$this->ap = 9;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."使出".$this->name."<br>";
		StatusHelper::random_abn($a,$b,50,$this);
	}
}

class AnnoyIsBodhi extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 326;
		$this->name = "煩悩即菩提";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 130;
		$this->ap = 11;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."使出".$this->name."<br>";
		StatusHelper::random_abn($a,$b,60,$this);
	}
}

class BadBlow extends SingleSptClass {
	
	public function __construct() {
		$this->id = 327;
		$this->name = "淀んだ吐息";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 30;
		$this->ap = 3;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."发动".$this->name."<br>";
		StatusHelper::bad_blow($a,$b);
	}
}

class BadAir extends GroundSptClass {

	public function __construct() {
		$this->id = 328;
		$this->name = "淀んだ空気";			//技能名称
		$this->type = 11;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 50;
		$this->ap = 4;
	}
	
	public function action($a,$b) {	
		$_SESSION['show'] .= $a->name."发动".$this->name."<br>";
		StatusHelper::bad_air($b);			
	}
	
}

class WraithBreath extends GroundSptClass {

	public function __construct() {
		$this->id = 329;
		$this->name = "ウィルスブレス";			//技能名称
		$this->type = 11;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 60;
		$this->ap = 5;
		$this->ahits = 0;
		$this->tgtnum = 1;
	}
	
	public function action($a,$b) {	
		$_SESSION['show'] .= $a->name."发动".$this->name."<br>";
		$h = CalHelper::abn_cal($a,$b,40,$this->ahits,$this->tgtnum);
		$t = mt_rand(1,100);
		$_SESSION['result'] .= "ウィルスブレス成功率:".$h."，乱数:".$t."<br>";
		if($h >= $t) {
			$_SESSION['show'] .= $b->name."吸入了腐朽的气体，AP下降<p>";
			CalHelper::apointchange_2($b,-2);
		} else {
			$_SESSION['show'] .= $b->name."抵御住了腐朽的吐息<p>";
		}
	}
}

class SoulBreak extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 549;
		$this->name = "ソウルブレイク";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 120;
		$this->ap = 11;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."发动".$this->name."<br>";
		StatusHelper::random_abn($a,$b,50,$this,1);
	}
}

class AnimeFreeze extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 550;
		$this->name = "アニマフリーズ";			//技能名称
		$this->type = 11;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 120;
		$this->ap = 11;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."发动".$this->name."<br>";
		StatusHelper::random_abn($a,$b,50,$this,2);
	}
}

?>
